package com.example.demo;

import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;

import androidx.fragment.app.Fragment;

public class CategoryFragment extends Fragment {

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
        View view = inflater.inflate(R.layout.fragment_layout, container, false);

        TextView textView = view.findViewById(R.id.viewPagerFragmentTv);
        textView.setText("分类\n\n这是第二个Fragment");
        view.setBackgroundColor(0xFFCCFFCC); // 浅绿色背景

        return view;
    }
}